package jsyf.oa.entity.device;

import com.alibaba.fastjson.JSONObject;
import jsyf.oa.ientity.BaseEntity;

import javax.persistence.Entity;
import javax.persistence.Table;
import java.util.Date;

/**
 * Created by LT on 2018/3/6.
 */
@Entity
@Table(name = "T_DVC_DEVICE", schema = "oa", catalog = "")
public class DeviceEntity extends BaseEntity {

    private String createUser;

    private String companyId;

    private String brandId;

    private String modelId;

    private String sequence;

    private String storagePlace;

    private String state;

    private Integer year;

    private Integer hour;

    private String source;

    private String remark;

    private String inboundId;

    private String operatorName;

    private String deviceType;

    private String inboundPlace;

    private String regionManager;
    private String originalInvoice;
    private String certification;
    private String VECUHour;
    private String debtCarSubsidy;
    private String subsidyDescription;
    private String parkingSpaceNumber;

    private String deviceStatus;
    private String operatingConditions;
    private String attachment;
    private String constructionSite;
    private String latestWorkingHours;
    private String dailyWorkingHours;
    private String gpsWorkingHours;
    private String extendedAgreement;
    private Date deliveryDate;
    private Date staWaExpDate;
    private Date extWaExpDate;


    public String getRegionManager() {
        return regionManager;
    }

    public void setRegionManager(String regionManager) {
        this.regionManager = regionManager;
    }

    public String getOriginalInvoice() {
        return originalInvoice;
    }

    public void setOriginalInvoice(String originalInvoice) {
        this.originalInvoice = originalInvoice;
    }

    public String getCertification() {
        return certification;
    }

    public void setCertification(String certification) {
        this.certification = certification;
    }

    public String getVECUHour() {
        return VECUHour;
    }

    public void setVECUHour(String VECUHour) {
        this.VECUHour = VECUHour;
    }

    public String getDebtCarSubsidy() {
        return debtCarSubsidy;
    }

    public void setDebtCarSubsidy(String debtCarSubsidy) {
        this.debtCarSubsidy = debtCarSubsidy;
    }

    public String getSubsidyDescription() {
        return subsidyDescription;
    }

    public void setSubsidyDescription(String subsidyDescription) {
        this.subsidyDescription = subsidyDescription;
    }

    public String getParkingSpaceNumber() {
        return parkingSpaceNumber;
    }

    public void setParkingSpaceNumber(String parkingSpaceNumber) {
        this.parkingSpaceNumber = parkingSpaceNumber;
    }

    public String getCreateUser() {
        return createUser;
    }

    public void setCreateUser(String createUser) {
        this.createUser = createUser;
    }

    public String getCompanyId() {
        return companyId;
    }

    public void setCompanyId(String companyId) {
        this.companyId = companyId;
    }

    public String getBrandId() {
        return brandId;
    }

    public void setBrandId(String brandId) {
        this.brandId = brandId;
    }

    public String getModelId() {
        return modelId;
    }

    public void setModelId(String modelId) {
        this.modelId = modelId;
    }

    public String getSequence() {
        return sequence;
    }

    public void setSequence(String sequence) {
        this.sequence = sequence;
    }

    public String getStoragePlace() {
        return storagePlace;
    }

    public void setStoragePlace(String storagePlace) {
        this.storagePlace = storagePlace;
    }

    public String getState() {
        return state;
    }

    public void setState(String state) {
        this.state = state;
    }

    public Integer getYear() {
        return year;
    }

    public void setYear(Integer year) {
        this.year = year;
    }

    public Integer getHour() {
        return hour;
    }

    public void setHour(Integer hour) {
        this.hour = hour;
    }

    public String getSource() {
        return source;
    }

    public void setSource(String source) {
        this.source = source;
    }

    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }

    public String getInboundId() {
        return inboundId;
    }

    public void setInboundId(String inboundId) {
        this.inboundId = inboundId;
    }

    public String getOperatorName() {
        return operatorName;
    }

    public void setOperatorName(String operatorName) {
        this.operatorName = operatorName;
    }

    public String getDeviceType() {
        return deviceType;
    }

    public void setDeviceType(String deviceType) {
        this.deviceType = deviceType;
    }

    public String getInboundPlace() {
        return inboundPlace;
    }

    public void setInboundPlace(String inboundPlace) {
        this.inboundPlace = inboundPlace;
    }

    public String getDeviceStatus() {
        return deviceStatus;
    }

    public void setDeviceStatus(String deviceStatus) {
        this.deviceStatus = deviceStatus;
    }

    public String getOperatingConditions() {
        return operatingConditions;
    }

    public void setOperatingConditions(String operatingConditions) {
        this.operatingConditions = operatingConditions;
    }

    public String getAttachment() {
        return attachment;
    }

    public void setAttachment(String attachment) {
        this.attachment = attachment;
    }

    public String getConstructionSite() {
        return constructionSite;
    }

    public void setConstructionSite(String constructionSite) {
        this.constructionSite = constructionSite;
    }

    public String getLatestWorkingHours() {
        return latestWorkingHours;
    }

    public void setLatestWorkingHours(String latestWorkingHours) {
        this.latestWorkingHours = latestWorkingHours;
    }

    public String getDailyWorkingHours() {
        return dailyWorkingHours;
    }

    public void setDailyWorkingHours(String dailyWorkingHours) {
        this.dailyWorkingHours = dailyWorkingHours;
    }


    public String getGpsWorkingHours() {
        return gpsWorkingHours;
    }

    public void setGpsWorkingHours(String gpsWorkingHours) {
        this.gpsWorkingHours = gpsWorkingHours;
    }

    public String getExtendedAgreement() {
        return extendedAgreement;
    }

    public void setExtendedAgreement(String extendedAgreement) {
        this.extendedAgreement = extendedAgreement;
    }

    public Date getDeliveryDate() {
        return deliveryDate;
    }

    public void setDeliveryDate(Date deliveryDate) {
        this.deliveryDate = deliveryDate;
    }

    public Date getStaWaExpDate() {
        return staWaExpDate;
    }

    public void setStaWaExpDate(Date staWaExpDate) {
        this.staWaExpDate = staWaExpDate;
    }

    public Date getExtWaExpDate() {
        return extWaExpDate;
    }

    public void setExtWaExpDate(Date extWaExpDate) {
        this.extWaExpDate = extWaExpDate;
    }

    @Override
    public String getTableName() {
        return "T_DVC_DEVICE";
    }

    @Override
    public String getViewName() {
        return "V_DVC_DEVICE";
    }


    @Override
    public JSONObject getJSONObject() {
        JSONObject obj = new JSONObject();
        obj.put("ID", this.getId());
        obj.put("COMPANY_ID", this.getCompanyId());
        obj.put("BRAND_ID", this.getBrandId());
        obj.put("MODEL_ID", this.getModelId());
        obj.put("SEQUENCE", this.getSequence());
        obj.put("STORAGE_PLACE", this.getStoragePlace());
        obj.put("STATE", this.getState());
        obj.put("YEAR", this.getYear());
        obj.put("HOUR", this.getHour());
        obj.put("SOURCE", this.getSource());
        obj.put("CREATE_TIME", this.getCreateTime());
        obj.put("REMARK", this.getRemark());
        obj.put("INBOUND_ID", this.getInboundId());
        obj.put("OPERATOR_NAME", this.getOperatorName());
        obj.put("INBOUND_PLACE", this.getInboundPlace());
        obj.put("DEVICE_TYPE", this.getDeviceType());
        obj.put("DEL_FLAG", this.getDelFlag());
        obj.put("CREATE_USER", this.getCreateUser());
        obj.put("REGION_MANAGER", this.getRegionManager());
        obj.put("ORIGINAL_INVOICE", this.getOriginalInvoice());
        obj.put("CERTIFICATION", this.getCertification());
        obj.put("VECU_HOUR", this.getVECUHour());
        obj.put("DEBT_CAR_SUBSIDY", this.getDebtCarSubsidy());
        obj.put("SUBSIDY_DESCRIPTION", this.getSubsidyDescription());
        obj.put("PARKING_SPACENUMBER", this.getParkingSpaceNumber());

        obj.put("DEVICE_STATUS", this.getDeviceStatus());
        obj.put("OPERATING_CONDITIONS", this.getOperatingConditions());
        obj.put("ATTACHMENT", this.getAttachment());
        obj.put("CONSTRUCTION_SITE", this.getConstructionSite());
        obj.put("LATEST_WORKING_HOURS", this.getLatestWorkingHours());
        obj.put("DAILY_WORKING_HOURS", this.getDailyWorkingHours());
        obj.put("UPDATE_TIME", this.getUpdateTime());
        obj.put("GPS_WORKING_HOURS", this.getGpsWorkingHours());
        obj.put("EXTENDED_AGREEMENT", this.getExtendedAgreement());
        obj.put("DELIVERY_DATE", this.getDeliveryDate());
        obj.put("STA_WA_EXP_DATE", this.getStaWaExpDate());
        obj.put("EXT_WA_EXP_DATE", this.getExtWaExpDate());

        return obj;
    }

    @Override
    public JSONObject getJSONColumns() {
        JSONObject obj = new JSONObject();
        obj.put("ID", "id");
        obj.put("COMPANY_ID", "companyName");
        obj.put("BRAND_ID", "brandId");
        obj.put("MODEL_ID", "modelId");
        obj.put("SEQUENCE", "sequence");
        obj.put("STORAGE_PLACE", "storagePlace");
        obj.put("STATE", "state");
        obj.put("DEL_FLAG", "delFlag");
        obj.put("YEAR", "year");
        obj.put("HOUR", "hour");
        obj.put("SOURCE", "source");
        obj.put("CREATE_TIME", "createTime");
        obj.put("REMARK", "remark");
        obj.put("INBOUND_ID", "inboundId");
        obj.put("OPERATOR_NAME", "operatorName");
        obj.put("INBOUND_PLACE", "inboundPlace");
        obj.put("DEVICE_TYPE", "deviceType");
        obj.put("CREATE_USER", "createUser");

        obj.put("REGION_MANAGER", "regionManager");
        obj.put("ORIGINAL_INVOICE", "originalInvoice");
        obj.put("CERTIFICATION", "certification");
        obj.put("VECU_HOUR", "VECUHour");
        obj.put("DEBT_CAR_SUBSIDY", "debtCarSubsidy");
        obj.put("SUBSIDY_DESCRIPTION", "subsidyDescription");
        obj.put("PARKING_SPACENUMBER", "parkingSpaceNumber");

        obj.put("DEVICE_STATUS", "deviceStatus");
        obj.put("OPERATING_CONDITIONS", "operatingConditions");
        obj.put("ATTACHMENT","attachment");
        obj.put("CONSTRUCTION_SITE","constructionSite");
        obj.put("LATEST_WORKING_HOURS", "latestWorkingHours");
        obj.put("DAILY_WORKING_HOURS","dailyWorkingHours");
        obj.put("UPDATE_TIME", "updateTime");
        obj.put("GPS_WORKING_HOURS", "gpsWorkingHours");
        obj.put("EXTENDED_AGREEMENT", "extendedAgreement");
        obj.put("DELIVERY_DATE", "deliveryDate");
        obj.put("STA_WA_EXP_DATE", "staWaExpDate");
        obj.put("EXT_WA_EXP_DATE", "extWaExpDate");

        return obj;
    }

}
